# 7-7 判断火车票座位【字符串】
def tran():
    seat = input()

    if seat[:-1].isdigit() and seat[-1].isalpha():
        row = int(seat[:-1])
        position = seat[-1].upper()

        if row >= 1 and row <= 17:
            if position == 'A' or position == 'F':
                print('窗口')
            elif position == 'B':
                print('中间')
            elif position == 'C' or position == 'D':
                print('过道')
            else:
                print('输入错误')
        else:
            print('输入错误')
    else:
        print('输入错误')
tran()